import { LinValidator, Rule } from 'lin-mizar';

class TaskSearchValidator extends LinValidator {
  constructor() {
    super();
    this.q = new Rule('isNotEmpty', '必须传入搜索关键字');
  }
}

class CreateOrUpdateTaskValidator extends LinValidator {
  constructor() {
    super();
    this.name = new Rule('isNotEmpty', '必须传入标题');
    this.from = new Rule('isNotEmpty', '必须传入写信人');
    this.to = new Rule('isNotEmpty', '必须传入收信人');
    this.info = new Rule('isNotEmpty', '必须传入信息');
    this.time = new Rule('isNotEmpty', '必须传入时间');

  }
}

export { CreateOrUpdateTaskValidator, TaskSearchValidator };
